//============================================================================
// Name        : 2-11.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<stdio.h>

int main() {
	int base ;
	int exponent ;
	long result = 1;
	std::cout << "Please input base:" << std::endl;
	std::cin >> base;
	std::cout << "Please input exponent:" << std::endl;
	std::cin >> exponent;
	if(exponent < 0)
	{
		printf("\nexponent<0\n");
		std::cout << "Exponent cannot be smaller than 0!" << std::endl;
		return -1;
	}
	else
		{
		printf("\nexponent>0\n");
			for(int cnt = 1; cnt <= exponent; cnt++)
			{
				result *= base;
			}
		}
	std::cout << "The result of " << base << " raised to the power of " << exponent << " is :" << result << std::endl;
	return 0;
}
